using System.Configuration;

namespace Altairis.Web.Management.Configuration {

    public class HostRedirectorElement : ConfigurationElement {

        [ConfigurationProperty("enabled", DefaultValue = false, IsRequired = false)]
        public bool Enabled {
            get { return (bool)this["enabled"]; }
            set { this["enabled"] = value; }
        }

        [ConfigurationProperty("verbs", IsRequired = false, DefaultValue = "GET")]
        [RegexStringValidator("^([A-Z]+[, ]?)+$")]
        public string Verbs {
            get { return (string)this["verbs"]; }
            set { this["verbs"] = value; }
        }

        [ConfigurationProperty("excludeLocalRequests", IsRequired = false, DefaultValue = true)]
        public bool ExcludeLocalRequests {
            get { return (bool)this["excludeLocalRequests"]; }
            set { this["excludeLocalRequests"] = value; }
        }

        [ConfigurationProperty("hostName", DefaultValue = "", IsRequired = false)]
        public string HostName {
            get { return (string)this["hostName"]; }
            set { this["hostName"] = value; }
        }

        [ConfigurationProperty("permanent", DefaultValue = true, IsRequired = false)]
        public bool Permanent {
            get { return (bool)this["permanent"]; }
            set { this["permanent"] = value; }
        }

    }
}
